import { UserContext, ThemeContext } from "../util/context"
import ConsumerContext from "./consumerContext"
import UseContext from "./useContext"
export default function Provider() {
  return (
    <UserContext.Provider value={{ name: "username" }}>
      <ThemeContext.Provider value={{ color: "blue" }}>
        <div>
          {/*<h4>原来的context传递，取值麻烦，多层嵌套函数</h4>*/}
          {/*<ConsumerContext />*/}
          <h4>新学useContext传递，取值方便，没有嵌套函数</h4>
          <UseContext />
        </div>
      </ThemeContext.Provider>
    </UserContext.Provider>
  )
}
